use generator_prompts::SimplePromptGenerator;
use model_graph_types::assistant::prompts::PromptGenerateOptions;
use model_graph_types::assistant::prompts::PromptGeneratorBuildInTemplate;
use model_graph_types::assistant::prompts::PromptResult;
use tauri::{command, AppHandle, Runtime, State, Window};

use crate::handlers::ContextState;
use crate::handlers::Result;

use model_graph_types::assistant::prompts::PromptGenerator;

#[command]
pub async fn prompt_generate_with_buildin<R: Runtime>(
    _app: AppHandle<R>,
    _window: Window<R>,
    state: State<'_, ContextState>,
    buildin_template: PromptGeneratorBuildInTemplate,
    instruction: String,
    options: PromptGenerateOptions,
) -> Result<PromptResult> {
    //
    let _context = state.context.clone();
    Ok(SimplePromptGenerator::default()
        .generate_with_buildin(buildin_template, &instruction, options)
        .await?)
}
